import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/Home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    redirect: '/welcome',
    children: [{
        path: '/welcome',
        name: 'welcome',
        component: () => import('../views/welcome .vue')
      },
      {
        path: '/users',
        name: 'users',
        component: () => import('../views/users.vue')
      },
      {
        path: '/roles',
        name: 'roles',
        component: () => import('../views/roles.vue')
      },
      {
        path: '/rights',
        name: 'rights',
        component: () => import('../views/rights.vue')
      },
      {
        path: '/goods',
        name: 'goods',
        component: () => import('../views/goods.vue')
      },
      {
        path: '/addgoods',
        name: 'addgoods',
        component: () => import('../views/addgoods.vue')
      },
      {
        path: '/categories',
        name: 'categories',
        component: () => import('../views/categories.vue')
      },
      {
        path: '/params',
        name: 'params',
        component: () => import('../views/params.vue')
      },
      {
        path: '/orders',
        name: 'orders',
        component: () => import('../views/orders.vue')
      },
      {
        path: '/reports',
        name: 'reports',
        component: () => import('../views/reports.vue')
      },
      // // 角色列表第二次
      // {
      //   path: '/roles1',
      //   name: 'roles1',
      //   component: () => import('../views/roles1.vue')
      // },
      // {
      //   // 权限列表第二次
      //   path: '/rights1',
      //   name: 'rights1',
      //   component: () => import('../views/rights1.vue')
      // },
    ],
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router